#ifndef __SXE_COMPAT_UBUNTU_H__
#define __SXE_COMPAT_UBUNTU_H__

#if !UTS_UBUNTU_RELEASE_ABI
#error "UTS_UBUNTU_RELEASE_ABI is 0 or undefined"
#endif

#if !UBUNTU_VERSION_CODE
#error "UBUNTU_VERSION_CODE is 0 or undefined"
#endif

#ifndef UBUNTU_VERSION
#error "UBUNTU_VERSION is undefined"
#endif

#if (UBUNTU_VERSION_CODE >= UBUNTU_VERSION(5,4,0,0)) && \
    (UBUNTU_VERSION_CODE < UBUNTU_VERSION(5,5,0,0))
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_AF_XDP_ZERO_COPY
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_QUERY_PROG
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define XDP_SETUP_XSK_POOL XDP_SETUP_XSK_UMEM
#define xdp_convert_buff_to_frame convert_to_xdp_frame
#define xsk_tx_release xsk_umem_consume_tx_done
#define xsk_tx_completed xsk_umem_complete_tx
#define xsk_uses_need_wakeup xsk_umem_uses_need_wakeup
#define SXE_KERNEL_MATCHED
#endif

#if (UBUNTU_VERSION_CODE >= UBUNTU_VERSION(5,11,0,0)) && \
    (UBUNTU_VERSION_CODE < UBUNTU_VERSION(5,12,0,0))
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (UBUNTU_VERSION_CODE >= UBUNTU_VERSION(5,15,0,0)) && \
    (UBUNTU_VERSION_CODE < UBUNTU_VERSION(5,16,0,0))
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_ETHTOOL_COALESCE_EXTACK
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_ETH_IOCTL
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#endif 